<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3"> {{table.title}} </h1>
</div>
<div class="wrapper-md">
  <div class="panel panel-default">
    <div class="panel-heading">
      <div class="row">
        <div class="col-sm-6  ">

        <button class="btn m-b-xs w-xs btn-primary" 
          ng-click="table.addsearch()"
        >添加搜索</button>
        <!--<button class="btn m-b-xs w-xs btn-info"
          ng-click="table.print()"
        >打印</button>
        <button class="btn m-b-xs w-xs btn-warning"
          ng-click="table.excel()"
        >excel</button>-->
        <button class="btn m-b-xs w-xs btn-success"
          ng-click="table.search()"
        >搜索</button>

        <button class="btn m-b-xs w-xs btn-primary" 
          ng-repeat="btn in table.btns"
          ng-click="btn.click(table)"
          style="margin-right:3px;"
        >{{btn.name}}</button>

        </div>
      </div>
    </div>

   
    <div class="row wrapper" >

      <div class="col-sm-6 m-b-xs"
        ng-repeat="search in table.searchformarr"
      >

        <div class="input-group" >


          <div class="input-group-btn dropdown" dropdown="">
            <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">{{search.showtype}} <span class="caret"></span></button>
            <ul class="dropdown-menu">
              <li ng-repeat="item in table.searcharr"
                ng-click="table.searchtypeclick(item, search)"
              >
                <a href="">{{item.title}}</a>
              </li>
            </ul>
          </div>

          <input type="text" class="form-control" 
            ng-model="search.result[0].value"
            ng-if="search.type == 'txt'"
          >


          <ui-select ng-model="search.result[0].value" theme="bootstrap"
            ng-if="search.type == 'select'"
          >
            <ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.label}}</ui-select-match>
            <ui-select-choices 
            repeat="item.value as item in search.sel | filter: $select.search">
              <span ng-bind-html="item.label | highlight: $select.search"></span>
              <!-- <small ng-bind-html="item.email | highlight: $select.search"></small> -->
            </ui-select-choices>
          </ui-select>


          <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" 
          ng-model="search.result[0].label" is-open="search.result[0].opened" ng-required="true" close-text="Close" readonly
            ng-if="search.type == 'date2'"
          />
          <span class="input-group-btn"
            ng-if="search.type == 'date2'"
          >
            <button type="button" class="btn btn-default" 
            ng-click="table.open($event, search.result[0])"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>


          <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" 
          ng-model="search.result[1].label" is-open="search.result[1].opened" ng-required="true" close-text="Close" readonly
            ng-if="search.type == 'date2'"
          />
          <span class="input-group-btn"
            ng-if="search.type == 'date2'"
          >
            <button type="button" class="btn btn-default" 
            ng-click="table.open($event, search.result[1])"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>

          


          <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" 
          ng-model="search.result[0].label" is-open="search.result[0].opened" ng-required="true" close-text="Close" readonly
            ng-if="search.type == 'date1'"
          />
          <span class="input-group-btn"
            ng-if="search.type == 'date1'"
          >
            <button type="button" class="btn btn-default" 
            ng-click="table.open($event, search.result[0])"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>



          <span class="input-group-btn">
            <button class="btn btn-default" type="button"
              ng-click="table.delsearch($index)"
            >
              <i class="glyphicon glyphicon-remove red"></i>
            </button>
          </span>


        </div>


      </div>

      <!-- <div class="col-sm-6 m-b-xs">
        <div class="input-group m-b">
          <div class="input-group-btn dropdown" dropdown="">
            <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
            <ul class="dropdown-menu">
              <li><a href="">Action</a></li>
              <li><a href="">Another action</a></li>
              <li><a href="">Something else here</a></li>
              <li class="divider"></li>
              <li><a href="">Separated link</a></li>
            </ul>
          </div>

          <ui-select ng-model="person.selected" theme="bootstrap">
            <ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
            <ui-select-choices repeat="item in people | filter: $select.search">
              <span ng-bind-html="item.name | highlight: $select.search"></span>
              <small ng-bind-html="item.email | highlight: $select.search"></small>
            </ui-select-choices>
          </ui-select>

          <span class="input-group-btn">
            <button class="btn btn-danger" type="button">
              <i class="fa fa-minus"></i>
            </button>
          </span>
        </div>
      </div>


      <div class="col-sm-6 m-b-xs" ng-controller="DatepickerDemoCtrl">

        <div class="input-group m-b">
          <div class="input-group-btn dropdown " dropdown="">
            <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
            <ul class="dropdown-menu">
              <li><a href="">Action</a></li>
              <li><a href="">Another action</a></li>
              <li><a href="">Something else here</a></li>
              <li class="divider"></li>
              <li><a href="">Separated link</a></li>
            </ul>
          </div>
          <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
          <span class="input-group-btn">
            <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>
          
          <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
          <span class="input-group-btn">
            <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>

          <span class="input-group-btn">
            <button class="btn btn-default" type="button">
              <i class="fa fa-minus red"></i>
            </button>
          </span>

        </div>

      </div>





      <div class="col-sm-6 m-b-xs" ng-controller="DatepickerDemoCtrl">

        <div class="input-group m-b">
          <div class="input-group-btn dropdown " dropdown="">
            <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
            <ul class="dropdown-menu">
              <li><a href="">Action</a></li>
              <li><a href="">Another action</a></li>
              <li><a href="">Something else here</a></li>
              <li class="divider"></li>
              <li><a href="">Separated link</a></li>
            </ul>
          </div>
          <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
          <span class="input-group-btn">
            <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
          </span>

          <span class="input-group-btn">
            <button class="btn btn-danger" type="button">
              <i class="fa fa-minus"></i>
            </button>
          </span>
          
        </div>

      </div>

 -->

    
      
    </div>

    


    <table datatable="" 
      dt-options="table.dtOptions" 
      dt-columns="table.dtColumns" 
      dt-instance="table.dtInstance"
      class="table table-striped table-bordered"></table>
    
    </div>
  </div>
</div>